#define _CRT_SECURE_NO_WARNINGS 1
#include"Sort.h"

void ShellSort(int* a, int n)
{
	int gap = n;
	while (gap>0)
	{
		gap /= 2;
		for (int i = 0; i < n - gap; i++)
		{
			int end = i;
			int tmp = a[i + gap];
			while (end >= 0)
			{
				if (tmp < a[end])
				{
					a[end + gap] = a[end];
					end -= gap;
				}
				else
				{
					break;
				}
				
			}
			a[end + gap] = tmp;
		}
		}
		InsertSort(a, n);
	/*}*/
	
}